﻿
namespace EasyStep
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Configuration;


    public class WebBrowserDriverSection : ConfigurationSection
    {
        // Fields
        private static readonly ConfigurationProperty _propDefaultBDriver = new ConfigurationProperty("defaultWebBrowser", typeof(string), "IE");
        private static ConfigurationPropertyCollection _properties = new ConfigurationPropertyCollection();
        private static readonly ConfigurationProperty _propWebBrowserDrivers = new ConfigurationProperty("drivers", typeof(ProviderSettingsCollection), null, ConfigurationPropertyOptions.None);
       

        // Methods
        static WebBrowserDriverSection()
        {
            _properties.Add(_propWebBrowserDrivers);
            _properties.Add(_propDefaultBDriver);
        }


        // Properties
        [StringValidator(MinLength = 1), ConfigurationProperty("defaultWebBrowser", DefaultValue = "IE")]
        public string DefaultProvider
        {
            get
            {
                return (string)base[_propDefaultBDriver];
            }
            set
            {
                base[_propDefaultBDriver] = value;
            }
        }

        

        protected override ConfigurationPropertyCollection Properties
        {            
            get
            {
                return _properties;
            }
        }

        [ConfigurationProperty("drivers")]
        public ProviderSettingsCollection Drivers
        {
            get
            {
                return (ProviderSettingsCollection)base[_propWebBrowserDrivers];
            }
        }


    }
}
